package com.mercury.util;

import com.mercury.config.RootConfig;
import com.mercury.config.WebConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author ：tx
 * @description：初始化获取dispatherservlet和webapplication
 * @date ：Created in 2019/1/24 19:28
 * @modified By：
 * @version: 1.0
 */
public class MercuryInit extends AbstractAnnotationConfigDispatcherServletInitializer {  //会自动配置dispatherservlet和webApplicationContext

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{RootConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }

}
